/*
AlliedBridge Content Management System
Copyright (C) 2006 AlliedBridge

This program is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation;

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.volume4.authentication;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;

public class logout extends HttpServlet {    


	public void doGet (HttpServletRequest request,
				HttpServletResponse response)
				throws ServletException, IOException {
                                    
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
	              
	try {	         
                HttpSession session = request.getSession();       
                session.invalidate();                 
                
                String app_root = request.getContextPath();
                response.sendRedirect(app_root + "/authentication/");
        
} catch (Exception e) {
	e.printStackTrace();
}


    }
    public void doPost(HttpServletRequest request,
                        HttpServletResponse response)
       throws ServletException, IOException {
           doGet(request, response);
    }
}